<template>
  <div class="">
    <div class="">
      <van-field
        :disabled="!edit"
        label-class="label"
        v-model="addInfo.address"
        name="施工地址"
        label="施工地址"
        placeholder="请输入施工地址"
        :rules="[{ required: true, message: '请输入施工地址' }]"
      />
    </div>
  </div>
</template>
<script setup lang="ts">
import { defineProps, reactive, watchEffect, defineExpose } from "vue";

const props = defineProps({
  edit: { type: Boolean },
  addInfo: { type: Object as any },
});
const addInfo = reactive({
  address: "",
});
watchEffect(() => {
  if (props.addInfo) {
    addInfo.address = props.addInfo.address;
  }
});
defineExpose({
  addInfo,
});
</script>
